feat: add "My" footer tab and personal page with six blocks#76
feat: add "My" footer tab and personal page with six blocks#76gushishang wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4627ad8b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onMounted(async () => { | ||
| if (!checkLogin(false)) { | ||
| showLoginModel() | ||
| isLoading.value = false | ||
| return |
There was a problem hiding this comment.
Refresh data after login when page is cached
This page only loads data in onMounted, but the route is marked keepAlive, so when an unauthenticated user opens /my, the component returns early and stays cached with empty blocks; after completing login and returning to /my, onMounted will not run again and the page remains empty until a full reload. Please trigger the same load flow on activation or on userLogin so cached instances recover.
Useful? React with 👍 / 👎.
| const [publishedExp, publishedDiscussion, favoriteExp, favoriteDiscussion, supportExp, supportDiscussion] = | ||
| await Promise.all([ | ||
| querySummaries('Experiment', null), | ||
| querySummaries('Discussion', null), | ||
| querySummaries('Experiment', 'Favorite'), | ||
| querySummaries('Discussion', 'Favorite'), | ||
| querySummaries('Experiment', 'Support'), | ||
| querySummaries('Discussion', 'Support'), | ||
| ]) |
There was a problem hiding this comment.
Guard parallel queries so loading state always clears
The six requests are awaited with Promise.all without any error handling, and getData can throw on transport failures (see src/services/api/getData.ts catch path). If one request rejects, isLoading is never set to false and the page stays in a perpetual loading state with an unhandled rejection. Wrap the load in try/finally (and optionally handle per-block failures) so the UI can recover.
Useful? React with 👍 / 👎.
Motivation
Description
/myand asrc/views/My.vuepage that reuses the existingBlockcomponent and Home-style grid to render six ListBlock sections assembled from server query results.My.vuevia sixgetData('/Contents/QueryExperiments')calls combiningCategory(Experiment/Discussion) andSpecial(null/Favorite/Support), and the page requires login (opens login modal if not authenticated).src/components/utils/Footer.vuethat links to/my.footer.myandmyPage.*block titles insrc/i18n/{zh,en,de,ja,fr}.tsso the UI is localized.Testing
npm run lint:i18nwhich passed.npm run build(TypeScript + Vite + PWA steps) which completed successfully.Codex Task